*Change file path as needed*

pwd
use "GH_Replication.dta", clear

* Add IWD IWD_war_id

generate IWD_war_id =.

replace	IWD_war_id	=	47	if	ccode	==	150	&	warname	==	"Chaco1932-1935"
replace	IWD_war_id	=	47	if	ccode	==	145	&	warname	==	"Chaco1932-1935"
replace	IWD_war_id	=	48	if	ccode	==	678	&	warname	==	"SaudiArabia-Yemen1934"
replace	IWD_war_id	=	48	if	ccode	==	670	&	warname	==	"SaudiArabia-Yemen1934"
replace	IWD_war_id	=	49	if	ccode	==	325	&	warname	==	"Italo-Ethiopian1935-1936"
replace	IWD_war_id	=	49	if	ccode	==	530	&	warname	==	"Italo-Ethiopian1935-1936"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Poland1939"
replace	IWD_war_id	=	53	if	ccode	==	290	&	warname	==	"Germany-Poland1939"
replace	IWD_war_id	=	51	if	ccode	==	712	&	warname	==	"Nomohan1939"
replace	IWD_war_id	=	51	if	ccode	==	740	&	warname	==	"Nomohan1939"
replace	IWD_war_id	=	51	if	ccode	==	365	&	warname	==	"Nomohan1939"
replace	IWD_war_id	=	52	if	ccode	==	365	&	warname	==	"Russo-Finnish1939-1940"
replace	IWD_war_id	=	52	if	ccode	==	375	&	warname	==	"Russo-Finnish1939-1940"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Belgium1940"
replace	IWD_war_id	=	53	if	ccode	==	211	&	warname	==	"Germany-Belgium1940"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Holland1940"
replace	IWD_war_id	=	53	if	ccode	==	220	&	warname	==	"Germany-France1939"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-France1939"
replace	IWD_war_id	=	53	if	ccode	==	210	&	warname	==	"Germany-Holland1940"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Denmark1940"
replace	IWD_war_id	=	53	if	ccode	==	390	&	warname	==	"Germany-Denmark1940"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Norway1940"
replace	IWD_war_id	=	53	if	ccode	==	385	&	warname	==	"Germany-Norway1940"
replace	IWD_war_id	=	53	if	ccode	==	350	&	warname	==	"Italy-Greece1940"
replace	IWD_war_id	=	53	if	ccode	==	325	&	warname	==	"Italy-Greece1940"
replace	IWD_war_id	=	53	if	ccode	==	2	&	warname	==	"Japan-UnitedStates1941-1945"
replace	IWD_war_id	=	53	if	ccode	==	740	&	warname	==	"Japan-UnitedStates1941-1945"
replace	IWD_war_id	=	53	if	ccode	==	325	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	200	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	2	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	200	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	2	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-SovietUnion1941-1945"
replace	IWD_war_id	=	53	if	ccode	==	365	&	warname	==	"Germany-SovietUnion1941-1945"
replace	IWD_war_id	=	53	if	ccode	==	345	&	warname	==	"Germany-Yugoslavia1941"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Yugoslavia1941"
replace	IWD_war_id	=	53	if	ccode	==	255	&	warname	==	"Germany-Greece1941"
replace	IWD_war_id	=	53	if	ccode	==	350	&	warname	==	"Germany-Greece1941"
replace	IWD_war_id	=	54	if	ccode	==	770	&	warname	==	"India-Pakistan1948"
replace	IWD_war_id	=	54	if	ccode	==	750	&	warname	==	"India-Pakistan1948"
replace	IWD_war_id	=	55	if	ccode	==	652	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	660	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	666	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	663	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	666	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	651	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	645	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	55	if	ccode	==	666	&	warname	==	"Palestine1948-1949"
replace	IWD_war_id	=	56	if	ccode	==	732	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	100	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	220	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	20	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	200	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	20	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	900	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	731	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	900	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	840	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	530	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	2	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	210	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	800	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	211	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	2	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	350	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	100	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	220	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	350	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	732	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	200	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	732	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	640	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	710	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	731	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	731	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	211	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	840	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	800	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	210	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	640	&	warname	==	"Korean War"
replace	IWD_war_id	=	56	if	ccode	==	530	&	warname	==	"Korean War"
replace	IWD_war_id	=	59	if	ccode	==	310	&	warname	==	"Russo-Hungarian1956"
replace	IWD_war_id	=	59	if	ccode	==	365	&	warname	==	"Russo-Hungarian1956"
replace	IWD_war_id	=	58	if	ccode	==	220	&	warname	==	"Sinai1956"
replace	IWD_war_id	=	58	if	ccode	==	651	&	warname	==	"Sinai1956"
replace	IWD_war_id	=	58	if	ccode	==	666	&	warname	==	"Sinai1956"
replace	IWD_war_id	=	58	if	ccode	==	651	&	warname	==	"Sinai1956"
replace	IWD_war_id	=	58	if	ccode	==	200	&	warname	==	"Sinai1956"
replace	IWD_war_id	=	61	if	ccode	==	750	&	warname	==	"Sino-Indian1962"
replace	IWD_war_id	=	61	if	ccode	==	710	&	warname	==	"Sino-Indian1962"
replace	IWD_war_id	=	63	if	ccode	==	770	&	warname	==	"India-Pakistan1965"
replace	IWD_war_id	=	63	if	ccode	==	750	&	warname	==	"India-Pakistan1965"
replace	IWD_war_id	=	62	if	ccode	==	800	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	817	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	2	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	840	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	732	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	811	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	816	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	62	if	ccode	==	900	&	warname	==	"US-Vietnam"
replace	IWD_war_id	=	64	if	ccode	==	666	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	64	if	ccode	==	651	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	64	if	ccode	==	663	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	64	if	ccode	==	652	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	64	if	ccode	==	666	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	64	if	ccode	==	666	&	warname	==	"SixDay1967"
replace	IWD_war_id	=	66	if	ccode	==	651	&	warname	==	"Israeli-Egyptian1969-1970"
replace	IWD_war_id	=	66	if	ccode	==	666	&	warname	==	"Israeli-Egyptian1969-1970"
replace	IWD_war_id	=	67	if	ccode	==	92	&	warname	==	"Honduras-El Salvador1969"
replace	IWD_war_id	=	67	if	ccode	==	91	&	warname	==	"Honduras-El Salvador1969"
replace	IWD_war_id	=	69	if	ccode	==	750	&	warname	==	"Bangledesh1971"
replace	IWD_war_id	=	69	if	ccode	==	770	&	warname	==	"Bangledesh1971"
replace	IWD_war_id	=	70	if	ccode	==	651	&	warname	==	"YomKippurI1973"
replace	IWD_war_id	=	70	if	ccode	==	666	&	warname	==	"YomKippurI1973"
replace	IWD_war_id	=	70	if	ccode	==	645	&	warname	==	"YomKippurII1973"
replace	IWD_war_id	=	70	if	ccode	==	652	&	warname	==	"YomKippurII1973"
replace	IWD_war_id	=	70	if	ccode	==	670	&	warname	==	"YomKippurII1973"
replace	IWD_war_id	=	70	if	ccode	==	666	&	warname	==	"YomKippurII1973"
replace	IWD_war_id	=	70	if	ccode	==	663	&	warname	==	"YomKippurII1973"
replace	IWD_war_id	=	71	if	ccode	==	640	&	warname	==	"Turco-Cypriot1974"
replace	IWD_war_id	=	71	if	ccode	==	352	&	warname	==	"Turco-Cypriot1974"
replace	IWD_war_id	=	74	if	ccode	==	811	&	warname	==	"Vietnam-Cambodia1975"
replace	IWD_war_id	=	74	if	ccode	==	816	&	warname	==	"Vietnam-Cambodia1975"
replace	IWD_war_id	=	62	if	ccode	==	816	&	warname	==	"Vietnamese1975"
replace	IWD_war_id	=	62	if	ccode	==	817	&	warname	==	"Vietnamese1975"
replace	IWD_war_id	=	73	if	ccode	==	520	&	warname	==	"Ethiopian-Somolian1977-1978"
replace	IWD_war_id	=	73	if	ccode	==	530	&	warname	==	"Ethiopian-Somolian1977-1978"
replace	IWD_war_id	=	73	if	ccode	==	40	&	warname	==	"Ethiopian-Somolian1977-1978"
replace	IWD_war_id	=	75	if	ccode	==	620	&	warname	==	"Ugandan-Tanzanian1978-1979"
replace	IWD_war_id	=	75	if	ccode	==	510	&	warname	==	"Ugandan-Tanzanian1978-1979"
replace	IWD_war_id	=	75	if	ccode	==	500	&	warname	==	"Ugandan-Tanzanian1978-1979"
replace	IWD_war_id	=	76	if	ccode	==	710	&	warname	==	"China-Vietnam1979"
replace	IWD_war_id	=	76	if	ccode	==	816	&	warname	==	"China-Vietnam1979"
replace	IWD_war_id	=	77	if	ccode	==	645	&	warname	==	"Iran-Iraq1980"
replace	IWD_war_id	=	77	if	ccode	==	630	&	warname	==	"Iran-Iraq1980"
replace	IWD_war_id	=	78	if	ccode	==	160	&	warname	==	"Falklands1982"
replace	IWD_war_id	=	78	if	ccode	==	200	&	warname	==	"Falklands1982"
replace	IWD_war_id	=	79	if	ccode	==	652	&	warname	==	"Israeli-Syria(Lebenon)1982"
replace	IWD_war_id	=	79	if	ccode	==	666	&	warname	==	"Israeli-Syria(Lebenon)1982"
replace	IWD_war_id	=	81	if	ccode	==	816	&	warname	==	"China-Vietnam 1987"
replace	IWD_war_id	=	81	if	ccode	==	710	&	warname	==	"China-Vietnam 1987"
replace	IWD_war_id	=	82	if	ccode	==	645	&	warname	==	"Iraq-Kuwait1990"
replace	IWD_war_id	=	82	if	ccode	==	690	&	warname	==	"Iraq-Kuwait1990"
replace	IWD_war_id	=	82	if	ccode	==	670	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	600	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	698	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	694	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	200	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	652	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	645	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	651	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	20	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	325	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	2	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	220	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	696	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	82	if	ccode	==	690	&	warname	==	"Gulf War I"
replace	IWD_war_id	=	83	if	ccode	==	373	&	warname	==	"Armenia-Azerbaijan1992"
replace	IWD_war_id	=	83	if	ccode	==	371	&	warname	==	"Armenia-Azerbaijan1992"
replace	IWD_war_id	=	90	if	ccode	==	517	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	565	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	490	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	500	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	540	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	483	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	90	if	ccode	==	552	&	warname	==	"Congo War1998"
replace	IWD_war_id	=	84	if	ccode	==	531	&	warname	==	"Badme Border War of 1998-2001"
replace	IWD_war_id	=	84	if	ccode	==	530	&	warname	==	"Badme Border War of 1998-2001"
replace	IWD_war_id	=	87	if	ccode	==	220	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	87	if	ccode	==	900	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	87	if	ccode	==	20	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	87	if	ccode	==	2	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	87	if	ccode	==	700	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	87	if	ccode	==	200	&	warname	==	"Invasion of Afghanistan of 2001"
replace	IWD_war_id	=	85	if	ccode	==	385	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	255	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	640	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	20	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	200	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	235	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	345	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	325	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	230	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	211	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	220	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	390	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	2	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	85	if	ccode	==	210	&	warname	==	"War for Kosovo of 1999"
replace	IWD_war_id	=	86	if	ccode	==	770	&	warname	==	"Kargil War of 1999"
replace	IWD_war_id	=	86	if	ccode	==	750	&	warname	==	"Kargil War of 1999"
replace	IWD_war_id	=	53	if	ccode	==	740	&	warname	==	"Sino-Japanese 1937"
replace	IWD_war_id	=	53	if	ccode	==	710	&	warname	==	"Sino-Japanese 1937"
replace	IWD_war_id	=	50	if	ccode	==	365	&	warname	==	"Changkufeng"
replace	IWD_war_id	=	50	if	ccode	==	740	&	warname	==	"Changkufeng"
replace	IWD_war_id	=	53	if	ccode	==	220	&	warname	==	"Franco-Thai1940"
replace	IWD_war_id	=	53	if	ccode	==	800	&	warname	==	"Franco-Thai1940"
replace	IWD_war_id	=	93	if	ccode	==	900	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	710	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	375	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	920	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	560	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	140	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	20	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	360	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	530	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	355	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	310	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	712	&	warname	==	"WWII"
replace	IWD_war_id	=	93	if	ccode	==	325	&	warname	==	"WWII"
replace	IWD_war_id	=	57	if	ccode	==	713	&	warname	==	"Off-shore Islands War of 1954-1955"
replace	IWD_war_id	=	57	if	ccode	==	710	&	warname	==	"Off-shore Islands War of 1954-1955"
replace	IWD_war_id	=	91	if	ccode	==	220	&	warname	==	"Ifni War of 1957-1958"
replace	IWD_war_id	=	91	if	ccode	==	230	&	warname	==	"Ifni War of 1957-1958"
replace	IWD_war_id	=	91	if	ccode	==	600	&	warname	==	"Ifni War of 1957-1958"
replace	IWD_war_id	=	60	if	ccode	==	710	&	warname	==	"Taiwan Straits War of 1958"
replace	IWD_war_id	=	60	if	ccode	==	713	&	warname	==	"Taiwan Straits War of 1958"
replace	IWD_war_id	=	65	if	ccode	==	812	&	warname	==	"Second Laotian War Phase 2 of 1968-1973"
replace	IWD_war_id	=	65	if	ccode	==	800	&	warname	==	"Second Laotian War Phase 2 of 1968-1973"
replace	IWD_war_id	=	65	if	ccode	==	2	&	warname	==	"Second Laotian War Phase 2 of 1968-1973"
replace	IWD_war_id	=	65	if	ccode	==	816	&	warname	==	"Second Laotian War Phase 2 of 1968-1973"
replace	IWD_war_id	=	68	if	ccode	==	816	&	warname	==	"War of the Communist Coalition of 1970-1971"
replace	IWD_war_id	=	68	if	ccode	==	2	&	warname	==	"War of the Communist Coalition of 1970-1971"
replace	IWD_war_id	=	68	if	ccode	==	817	&	warname	==	"War of the Communist Coalition of 1970-1971"
replace	IWD_war_id	=	68	if	ccode	==	811	&	warname	==	"War of the Communist Coalition of 1970-1971"
replace	IWD_war_id	=	72	if	ccode	==	560	&	warname	==	"War over Angola of 1975-1976"
replace	IWD_war_id	=	72	if	ccode	==	40	&	warname	==	"War over Angola of 1975-1976"
replace	IWD_war_id	=	72	if	ccode	==	540	&	warname	==	"War over Angola of 1975-1976"
replace	IWD_war_id	=	72	if	ccode	==	490	&	warname	==	"War over Angola of 1975-1976"
replace	IWD_war_id	=	74	if	ccode	==	816	&	warname	==	"Vietnamese-Cambodian Border War of 1977-1979"
replace	IWD_war_id	=	74	if	ccode	==	811	&	warname	==	"Vietnamese-Cambodian Border War of 1977-1979"
replace	IWD_war_id	=	80	if	ccode	==	483	&	warname	==	"War over the Aouzou Strip of 1986-1987"
replace	IWD_war_id	=	80	if	ccode	==	620	&	warname	==	"War over the Aouzou Strip of 1986-1987"
replace	IWD_war_id	=	92	if	ccode	==	344	&	warname	==	"War of Bosnia Independence of 1992"
replace	IWD_war_id	=	92	if	ccode	==	346	&	warname	==	"War of Bosnia Independence of 1992"
replace	IWD_war_id	=	92	if	ccode	==	345	&	warname	==	"War of Bosnia Independence of 1992"
replace	IWD_war_id	=	83	if	ccode	==	373	&	warname	==	"Azeri-Armenian War of 1993-1994"
replace	IWD_war_id	=	83	if	ccode	==	371	&	warname	==	"Azeri-Armenian War of 1993-1994"
replace	IWD_war_id	=	89	if	ccode	==	135	&	warname	==	"Cenepa Valley War of 1995"
replace	IWD_war_id	=	89	if	ccode	==	130	&	warname	==	"Cenepa Valley War of 1995"
replace	IWD_war_id	=	88	if	ccode	==	2	&	warname	==	"Invasion of Iraq of 2003"
replace	IWD_war_id	=	88	if	ccode	==	200	&	warname	==	"Invasion of Iraq of 2003"
replace	IWD_war_id	=	88	if	ccode	==	900	&	warname	==	"Invasion of Iraq of 2003"
replace	IWD_war_id	=	88	if	ccode	==	645	&	warname	==	"Invasion of Iraq of 2003"



*Subwar id variable*
gen double IWD_subwar = .

replace	IWD_subwar	=	53.1	if	ccode	==	255	&	warname	==	"Germany-Poland1939"
replace	IWD_subwar	=	53.1	if	ccode	==	290	&	warname	==	"Germany-Poland1939"
replace	IWD_subwar	=	53.2	if	ccode	==	255	&	warname	==	"Germany-Belgium1940"

replace	IWD_subwar	=	53.2	if	ccode	==	211	&	warname	==	"Germany-Belgium1940"
replace	IWD_subwar	=	53.3	if	ccode	==	255	&	warname	==	"Germany-Holland1940"
replace	IWD_subwar	=	53.4	if	ccode	==	220	&	warname	==	"Germany-France1939"
replace	IWD_subwar	=	53.4	if	ccode	==	255	&	warname	==	"Germany-France1939"
replace	IWD_subwar	=	53.3	if	ccode	==	210	&	warname	==	"Germany-Holland1940"
replace	IWD_subwar	=	53.5	if	ccode	==	255	&	warname	==	"Germany-Denmark1940"
replace	IWD_subwar	=	53.5	if	ccode	==	390	&	warname	==	"Germany-Denmark1940"
replace	IWD_subwar	=	53.6	if	ccode	==	255	&	warname	==	"Germany-Norway1940"
replace	IWD_subwar	=	53.6	if	ccode	==	385	&	warname	==	"Germany-Norway1940"
replace	IWD_subwar	=	53.7	if	ccode	==	350	&	warname	==	"Italy-Greece1940"
replace	IWD_subwar	=	53.7	if	ccode	==	325	&	warname	==	"Italy-Greece1940"
replace	IWD_subwar	=	53.8	if	ccode	==	2	&	warname	==	"Japan-UnitedStates1941-1945"
replace	IWD_subwar	=	53.8	if	ccode	==	740	&	warname	==	"Japan-UnitedStates1941-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	325	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	200	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	2	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	255	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	200	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	2	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.9	if	ccode	==	255	&	warname	==	"UnitedKingdom/UnitedStates-Germany/Italy1940-1945"
replace	IWD_subwar	=	53.11	if	ccode	==	255	&	warname	==	"Germany-SovietUnion1941-1945"
replace	IWD_subwar	=	53.11	if	ccode	==	365	&	warname	==	"Germany-SovietUnion1941-1945"
replace	IWD_subwar	=	53.12	if	ccode	==	345	&	warname	==	"Germany-Yugoslavia1941"
replace	IWD_subwar	=	53.12	if	ccode	==	255	&	warname	==	"Germany-Yugoslavia1941"
replace	IWD_subwar	=	53.13	if	ccode	==	255	&	warname	==	"Germany-Greece1941"
replace	IWD_subwar	=	53.13	if	ccode	==	350	&	warname	==	"Germany-Greece1941"
replace	IWD_subwar	=	53.14	if	ccode	==	740	&	warname	==	"Sino-Japanese 1937"
replace	IWD_subwar	=	53.14	if	ccode	==	710	&	warname	==	"Sino-Japanese 1937"
replace	IWD_subwar	=	53.15	if	ccode	==	220	&	warname	==	"Franco-Thai1940"
replace	IWD_subwar	=	53.15	if	ccode	==	800	&	warname	==	"Franco-Thai1940"
replace	IWD_subwar	=	82.1	if	ccode	==	645	&	warname	==	"Iraq-Kuwait1990"
replace	IWD_subwar	=	82.1	if	ccode	==	690	&	warname	==	"Iraq-Kuwait1990"
replace	IWD_subwar	=	82.2	if	ccode	==	2	&	warname	==	"Gulf War I"
replace	IWD_subwar	=	82.2	if	ccode	==	645	&	warname	==	"Gulf War I"
replace	IWD_subwar	=	74.1	if	ccode	==	811	&	warname	==	"Vietnam-Cambodia1975"
replace	IWD_subwar	=	74.1	if	ccode	==	816	&	warname	==	"Vietnam-Cambodia1975"
replace	IWD_subwar	=	74.2	if	ccode	==	811	&	warname	==	"Vietnamese-Cambodian Border War of 1977-1979"
replace	IWD_subwar	=	74.2	if	ccode	==	816	&	warname	==	"Vietnamese-Cambodian Border War of 1977-1979"
replace	IWD_subwar	=	70.1	if	ccode	==	666	&	warname	==	"YomKippurI1973"
replace	IWD_subwar	=	70.1	if	ccode	==	651	&	warname	==	"YomKippurI1973"
replace	IWD_subwar	=	70.2	if	ccode	==	666	&	warname	==	"YomKippurII1973"
replace	IWD_subwar	=	70.2	if	ccode	==	663	&	warname	==	"YomKippurII1973"
replace	IWD_subwar	=	62.2	if	ccode	==	816	&	warname	==	"Vietnamese1975"
replace	IWD_subwar	=	62.2	if	ccode	==	817	&	warname	==	"Vietnamese1975"
replace	IWD_subwar	=	62.1	if	ccode	==	816	&	warname	==	"US-Vietnam"
replace	IWD_subwar	=	62.1	if	ccode	==	2	&	warname	==	"US-Vietnam"
replace	IWD_subwar	=	56.1	if	ccode	==	731	&	warname	==	"Korean War"
replace	IWD_subwar	=	56.1	if	ccode	==	732	&	warname	==	"Korean War"
replace	IWD_subwar	=	56.2	if	ccode	==	710	&	warname	==	"Korean War"
replace	IWD_subwar	=	56.2	if	ccode	==	2	&	warname	==	"Korean War"



*IWD War Data*


gen IWD_WLT = .

replace	IWD_WLT	=	0	if	ccode	==	145	&	IWD_war_id	==	47	
replace	IWD_WLT	=	2	if	ccode	==	150	&	IWD_war_id	==	47	

replace	IWD_WLT	=	0	if	ccode	==	678	&	IWD_war_id	==	48
replace	IWD_WLT	=	2	if	ccode	==	670	&	IWD_war_id	==	48	

replace	IWD_WLT	=	0	if	ccode	==	530	&	IWD_war_id	==	49	
replace	IWD_WLT	=	2	if	ccode	==	325	&	IWD_war_id	==	49	

replace	IWD_WLT	=	0	if	ccode	==	740	&	IWD_war_id	==	50	
replace	IWD_WLT	=	2	if	ccode	==	365	&	IWD_war_id	==	50	

replace	IWD_WLT	=	0	if	ccode	==	740	&	IWD_war_id	==	51	
replace	IWD_WLT	=	2	if	ccode	==	365	&	IWD_war_id	==	51	
replace	IWD_WLT	=	.	if	ccode	==	712	&	IWD_war_id	==	51	

replace	IWD_WLT	=	0	if	ccode	==	375	&	IWD_war_id	==	52	
replace	IWD_WLT	=	2	if	ccode	==	365	&	IWD_war_id	==	52	

replace	IWD_WLT	=	.	if	ccode	==	210	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	211	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	290	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	345	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	350	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	385	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	390	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	740	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	800	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	325	&	IWD_war_id	==	53	
replace	IWD_WLT	=	.	if	ccode	==	710	&	IWD_war_id	==	53	
replace	IWD_WLT	=	2	if	ccode	==	2	&	IWD_war_id	==	53	
replace	IWD_WLT	=	2	if	ccode	==	365	&	IWD_war_id	==	53	
replace	IWD_WLT	=	0	if	ccode	==	255	&	IWD_war_id	==	53	
replace	IWD_WLT	=	0	if	ccode	==	740	&	IWD_war_id	==	53	

replace	IWD_WLT	=	1	if	ccode	==	750	&	IWD_war_id	==	54	
replace	IWD_WLT	=	1	if	ccode	==	770	&	IWD_war_id	==	54	

replace	IWD_WLT	=	0	if	ccode	==	651	&	IWD_war_id	==	55	
replace	IWD_WLT	=	.	if	ccode	==	652	&	IWD_war_id	==	55	
replace	IWD_WLT	=	.	if	ccode	==	645	&	IWD_war_id	==	55	
replace	IWD_WLT	=	.	if	ccode	==	660	&	IWD_war_id	==	55	
replace	IWD_WLT	=	.	if	ccode	==	663	&	IWD_war_id	==	55	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	55	

replace	IWD_WLT	=	.	if	ccode	==	20	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	100	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	210	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	211	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	350	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	530	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	640	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	731	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	731	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	732	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	732	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	800	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	840	&	IWD_war_id	==	56	
replace	IWD_WLT	=	.	if	ccode	==	900	&	IWD_war_id	==	56	
replace	IWD_WLT	=	1	if	ccode	==	2	&	IWD_war_id	==	56	
replace	IWD_WLT	=	1	if	ccode	==	710	&	IWD_war_id	==	56	

replace	IWD_WLT	=	0	if	ccode	==	713	&	IWD_war_id	==	57	
replace	IWD_WLT	=	2	if	ccode	==	710	&	IWD_war_id	==	57	

replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	58	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	58	
replace	IWD_WLT	=	.	if	ccode	==	651	&	IWD_war_id	==	58	
replace	IWD_WLT	=	0	if	ccode	==	651	&	IWD_war_id	==	58	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	58	

replace	IWD_WLT	=	.	if	ccode	==	310	&	IWD_war_id	==	59	
replace	IWD_WLT	=	.	if	ccode	==	365	&	IWD_war_id	==	59	

replace	IWD_WLT	=	1	if	ccode	==	710	&	IWD_war_id	==	60	
replace	IWD_WLT	=	1	if	ccode	==	713	&	IWD_war_id	==	60	

replace	IWD_WLT	=	0	if	ccode	==	750	&	IWD_war_id	==	61	
replace	IWD_WLT	=	2	if	ccode	==	710	&	IWD_war_id	==	61	

replace	IWD_WLT	=	.	if	ccode	==	732&	IWD_war_id	==	62	
replace	IWD_WLT	=	.	if	ccode	==	800	&	IWD_war_id	==	62	
replace	IWD_WLT	=	.	if	ccode	==	811	&	IWD_war_id	==	62	
replace	IWD_WLT	=	.	if	ccode	==	817	&	IWD_war_id	==	62	
replace	IWD_WLT	=	.	if	ccode	==	840	&	IWD_war_id	==	62	
replace	IWD_WLT	=	.	if	ccode	==	900	&	IWD_war_id	==	62	
replace	IWD_WLT	=	1	if	ccode	==	816	&	IWD_war_id	==	62	
replace	IWD_WLT	=	1	if	ccode	==	2	&	IWD_war_id	==	62	

replace	IWD_WLT	=	1	if	ccode	==	750	&	IWD_war_id	==	63	
replace	IWD_WLT	=	1	if	ccode	==	770	&	IWD_war_id	==	63	

replace	IWD_WLT	=	.	if	ccode	==	652	&	IWD_war_id	==	64	
replace	IWD_WLT	=	.	if	ccode	==	663	&	IWD_war_id	==	64	
replace	IWD_WLT	=	0	if	ccode	==	651	&	IWD_war_id	==	64	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	64	

replace	IWD_WLT	=	1	if	ccode	==	2	&	IWD_war_id	==	65	
replace	IWD_WLT	=	1	if	ccode	==	800	&	IWD_war_id	==	65	
replace	IWD_WLT	=	1	if	ccode	==	812	&	IWD_war_id	==	65	
replace	IWD_WLT	=	1	if	ccode	==	816	&	IWD_war_id	==	65	

replace	IWD_WLT	=	0	if	ccode	==	651	&	IWD_war_id	==	66	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	66	

replace	IWD_WLT	=	0	if	ccode	==	91	&	IWD_war_id	==	67	
replace	IWD_WLT	=	2	if	ccode	==	92	&	IWD_war_id	==	67	

replace	IWD_WLT	=	.	if	ccode	==	2	&	IWD_war_id	==	68	
replace	IWD_WLT	=	.	if	ccode	==	817	&	IWD_war_id	==	68	
replace	IWD_WLT	=	0	if	ccode	==	811	&	IWD_war_id	==	68	
replace	IWD_WLT	=	2	if	ccode	==	816	&	IWD_war_id	==	68	

replace	IWD_WLT	=	0	if	ccode	==	770	&	IWD_war_id	==	69	
replace	IWD_WLT	=	2	if	ccode	==	750	&	IWD_war_id	==	69	

replace	IWD_WLT	=	.	if	ccode	==	645	&	IWD_war_id	==	70	
replace	IWD_WLT	=	.	if	ccode	==	651	&	IWD_war_id	==	70	
replace	IWD_WLT	=	.	if	ccode	==	663	&	IWD_war_id	==	70	
replace	IWD_WLT	=	.	if	ccode	==	670	&	IWD_war_id	==	70	
replace	IWD_WLT	=	0	if	ccode	==	652	&	IWD_war_id	==	70	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	70	

replace	IWD_WLT	=	0	if	ccode	==	352	&	IWD_war_id	==	71	
replace	IWD_WLT	=	2	if	ccode	==	640	&	IWD_war_id	==	71	

replace	IWD_WLT	=	0	if	ccode	==	490	&	IWD_war_id	==	72	
replace	IWD_WLT	=	.	if	ccode	==	560	&	IWD_war_id	==	72	
replace	IWD_WLT	=	.	if	ccode	==	40	&	IWD_war_id	==	72	
replace	IWD_WLT	=	2	if	ccode	==	540	&	IWD_war_id	==	72	

replace	IWD_WLT	=	0	if	ccode	==	520	&	IWD_war_id	==	73	
replace	IWD_WLT	=	2	if	ccode	==	40	&	IWD_war_id	==	73	
replace	IWD_WLT	=	2	if	ccode	==	530	&	IWD_war_id	==	73	

replace	IWD_WLT	=	0	if	ccode	==	811	&	IWD_war_id	==	74	
replace	IWD_WLT	=	2	if	ccode	==	816	&	IWD_war_id	==	74	

replace	IWD_WLT	=	.	if	ccode	==	500	&	IWD_war_id	==	75	
replace	IWD_WLT	=	0	if	ccode	==	620	&	IWD_war_id	==	75	
replace	IWD_WLT	=	2	if	ccode	==	510	&	IWD_war_id	==	75	

replace	IWD_WLT	=	1	if	ccode	==	816	&	IWD_war_id	==	76	
replace	IWD_WLT	=	1	if	ccode	==	710	&	IWD_war_id	==	76	

replace	IWD_WLT	=	1	if	ccode	==	630	&	IWD_war_id	==	77	
replace	IWD_WLT	=	1	if	ccode	==	645	&	IWD_war_id	==	77	

replace	IWD_WLT	=	0	if	ccode	==	160	&	IWD_war_id	==	78	
replace	IWD_WLT	=	2	if	ccode	==	200	&	IWD_war_id	==	78	

replace	IWD_WLT	=	0	if	ccode	==	652	&	IWD_war_id	==	79	
replace	IWD_WLT	=	2	if	ccode	==	666	&	IWD_war_id	==	79	

replace	IWD_WLT	=	0	if	ccode	==	620	&	IWD_war_id	==	80	
replace	IWD_WLT	=	2	if	ccode	==	483	&	IWD_war_id	==	80	

replace	IWD_WLT	=	1	if	ccode	==	710	&	IWD_war_id	==	81	
replace	IWD_WLT	=	1	if	ccode	==	816	&	IWD_war_id	==	81	

replace	IWD_WLT	=	.	if	ccode	==	20	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	325	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	600	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	651	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	652	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	670	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	690	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	694	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	696	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	698	&	IWD_war_id	==	82	
replace	IWD_WLT	=	0	if	ccode	==	645	&	IWD_war_id	==	82	
replace	IWD_WLT	=	.	if	ccode	==	690	&	IWD_war_id	==	82	
replace	IWD_WLT	=	2	if	ccode	==	2	&	IWD_war_id	==	82	

replace	IWD_WLT	=	0	if	ccode	==	373	&	IWD_war_id	==	83	
replace	IWD_WLT	=	2	if	ccode	==	371	&	IWD_war_id	==	83	

replace	IWD_WLT	=	1	if	ccode	==	530	&	IWD_war_id	==	84	
replace	IWD_WLT	=	1	if	ccode	==	531	&	IWD_war_id	==	84	

replace	IWD_WLT	=	.	if	ccode	==	20	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	210	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	211	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	230	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	235	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	255	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	325	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	385	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	390	&	IWD_war_id	==	85	
replace	IWD_WLT	=	.	if	ccode	==	640	&	IWD_war_id	==	85	
replace	IWD_WLT	=	0	if	ccode	==	345	&	IWD_war_id	==	85	
replace	IWD_WLT	=	2	if	ccode	==	2	&	IWD_war_id	==	85	

replace	IWD_WLT	=	0	if	ccode	==	770	&	IWD_war_id	==	86	
replace	IWD_WLT	=	2	if	ccode	==	750	&	IWD_war_id	==	86	

replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	87	
replace	IWD_WLT	=	.	if	ccode	==	20	&	IWD_war_id	==	87	
replace	IWD_WLT	=	.	if	ccode	==	220	&	IWD_war_id	==	87	
replace	IWD_WLT	=	.	if	ccode	==	900	&	IWD_war_id	==	87	
replace	IWD_WLT	=	0	if	ccode	==	700	&	IWD_war_id	==	87	
replace	IWD_WLT	=	2	if	ccode	==	2	&	IWD_war_id	==	87	

replace	IWD_WLT	=	.	if	ccode	==	200	&	IWD_war_id	==	88	
replace	IWD_WLT	=	.	if	ccode	==	900	&	IWD_war_id	==	88	
replace	IWD_WLT	=	0	if	ccode	==	645	&	IWD_war_id	==	88	
replace	IWD_WLT	=	2	if	ccode	==	2	&	IWD_war_id	==	88	


gen Subwar_WLT = .

replace	Subwar_WLT	=	2	if	IWD_subwar == 53.1 & ccode == 255
replace	Subwar_WLT	=	0	if	IWD_subwar == 53.1 & ccode == 290

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.11 & ccode == 255
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.11 & ccode == 365

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.12 & ccode == 345
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.12 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.13 & ccode == 350
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.13 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.2 & ccode == 211
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.2 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.3 & ccode == 210
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.3 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.4 & ccode == 220
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.4 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.5 & ccode == 390
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.5 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.6 & ccode == 385
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.6 & ccode == 255

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.8 & ccode == 740
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.8 & ccode == 2

replace	Subwar_WLT	=	0	if	IWD_subwar == 53.9 & ccode == 255 & battlename == "Operation Diadem (Gustav Line Breakout, May 11-18)"
replace	Subwar_WLT	=	2	if	IWD_subwar == 53.9 & ccode == 2 & battlename == "Operation Diadem (Gustav Line Breakout, May 11-18)"

replace	Subwar_WLT	=	1	if	IWD_subwar == 56.2 & ccode == 2 & battlename == "Punchbowl Battles"
replace	Subwar_WLT	=	1	if	IWD_subwar == 56.2 & ccode == 710 & battlename == "Punchbowl Battles"

replace	Subwar_WLT	=	1	if	IWD_subwar == 62.1 & ccode == 2 
replace	Subwar_WLT	=	1	if	IWD_subwar == 62.1 & ccode == 816

replace	Subwar_WLT	=	0	if	IWD_subwar == 62.2 & ccode == 817
replace	Subwar_WLT	=	2	if	IWD_subwar == 62.2 & ccode == 816 

replace	Subwar_WLT	=	0	if	IWD_subwar == 70.1 & ccode == 651
replace	Subwar_WLT	=	2	if	IWD_subwar == 70.1 & ccode == 666 

replace	Subwar_WLT	=	0	if	IWD_subwar == 70.2 & ccode == 663
replace	Subwar_WLT	=	2	if	IWD_subwar == 70.2 & ccode == 666 

replace	Subwar_WLT	=	0	if	IWD_subwar == 74.1 & ccode == 811
replace	Subwar_WLT	=	2	if	IWD_subwar == 74.1 & ccode == 816 

replace	Subwar_WLT	=	0	if	IWD_subwar == 74.2 & ccode == 811
replace	Subwar_WLT	=	2	if	IWD_subwar == 74.2 & ccode == 816 

replace	Subwar_WLT	=	0	if	IWD_subwar == 82.1 & ccode == 690
replace	Subwar_WLT	=	2	if	IWD_subwar == 82.1 & ccode == 645 

replace	Subwar_WLT	=	0	if	IWD_subwar == 82.2 & ccode == 645
replace	Subwar_WLT	=	2	if	IWD_subwar == 82.2 & ccode == 2 


*Tougher cases to code*
*Japan/China - Fighting ended by Japanese surrender to US forces*
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.14 & ccode == 740
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.14 & ccode == 710
*France/Thailand - Japan enforced peace*
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.15 & ccode == 220
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.15 & ccode == 800
*Italy/Greece - Greece repelled Italian attacks and took ground in Albania, and are only defeated after German intervention*
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.7 & ccode == 325
replace	Subwar_WLT	=	1	if	IWD_subwar == 53.7 & ccode == 350
*Seems reasonable to conclude that N.Korea defeated S.Korea in battle. Pusan was only saved by UN intervention.*
replace	Subwar_WLT	=	0	if	IWD_subwar == 56.1 & ccode == 732 & battlename == "Invasion over 38th Parallel"
replace	Subwar_WLT	=	2	if	IWD_subwar == 56.1 & ccode == 731 & battlename == "Invasion over 38th Parallel"



*Create airsup_superiority codings

gen airsup =.

replace 	airsup	=	1	if	ccode	==	150	&	battlename	==	"Canada El Carmen, Nov 1934"
replace 	airsup	=	1	if	ccode	==	145	&	battlename	==	"Canada El Carmen, Nov 1934"
replace 	airsup	=	2	if	ccode	==	325	&	battlename	==	"Battle of Ogaden, April 1936"
replace 	airsup	=	0	if	ccode	==	530	&	battlename	==	"Battle of Ogaden, April 1936"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"September Campaign, Silesian Breakthrough"
replace 	airsup	=	0	if	ccode	==	290	&	battlename	==	"September Campaign, Silesian Breakthrough"
replace 	airsup	=	2	if	ccode	==	712	&	battlename	==	"Soviet Counteroffensive, Aug 20 1939"
replace 	airsup	=	0	if	ccode	==	740	&	battlename	==	"Soviet Counteroffensive, Aug 20 1939"
replace 	airsup	=	2	if	ccode	==	365	&	battlename	==	"Soviet Counteroffensive, Aug 20 1939"
replace 	airsup	=	2	if	ccode	==	365	&	battlename	==	"Soviet February Offensive (Summa)"
replace 	airsup	=	0	if	ccode	==	375	&	battlename	==	"Soviet February Offensive (Summa)"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"Eben-Emael"
replace 	airsup	=	0	if	ccode	==	211	&	battlename	==	"Eben-Emael"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"Battle of Netherlands"
replace 	airsup	=	0	if	ccode	==	220	&	battlename	==	"Battle for France, June 5 - 22, 1940"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"Battle for France, June 5 - 22, 1940"
replace 	airsup	=	0	if	ccode	==	210	&	battlename	==	"Battle of Netherlands"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"April 9 Landing"
replace 	airsup	=	0	if	ccode	==	390	&	battlename	==	"April 9 Landing"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"Trondheim"
replace 	airsup	=	0	if	ccode	==	385	&	battlename	==	"Trondheim"
replace 	airsup	=	0	if	ccode	==	350	&	battlename	==	"Greek Counteroffensive (Albanian Front, Nov 18-23, 1940)"
replace 	airsup	=	2	if	ccode	==	325	&	battlename	==	"Greek Counteroffensive (Albanian Front, Nov 18-23, 1940)"
replace 	airsup	=	1	if	ccode	==	2	&	battlename	==	"Guadalcanal (Henderson Field Oct 23-6)"
replace 	airsup	=	1	if	ccode	==	740	&	battlename	==	"Guadalcanal (Henderson Field Oct 23-6)"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"Operation Diadem (Gustav Line Breakout, May 11-18)"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Operation Diadem (Gustav Line Breakout, May 11-18)"
replace 	airsup	=	0	if	ccode	==	255	&	battlename	==	"Operation Cobra"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Operation Cobra"
replace 	airsup	=	0	if	ccode	==	255	&	battlename	==	"Operation Diadem (Gustav Line Breakout, May 11-18)"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"Winter Counteroffensive, Dec 1941 - Jan 1942"
replace 	airsup	=	0	if	ccode	==	365	&	battlename	==	"Winter Counteroffensive, Dec 1941 - Jan 1942"
replace 	airsup	=	0	if	ccode	==	345	&	battlename	==	"April Offensive, Southeastern Front"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"April Offensive, Southeastern Front"
replace 	airsup	=	2	if	ccode	==	255	&	battlename	==	"April 6-9 Offensive, Metaxas Line"
replace 	airsup	=	0	if	ccode	==	350	&	battlename	==	"April 6-9 Offensive, Metaxas Line"
replace 	airsup	=	1	if	ccode	==	770	&	battlename	==	"Naushera, Feb 6"
replace 	airsup	=	1	if	ccode	==	750	&	battlename	==	"Naushera, Feb 6"
replace 	airsup	=	1	if	ccode	==	652	&	battlename	==	"Operation Hiram (Oct 20-31)"
replace 	airsup	=	1	if	ccode	==	660	&	battlename	==	"Operation Hiram (Oct 20-31)"
replace 	airsup	=	1	if	ccode	==	666	&	battlename	==	"Jerusalem Corridor (July)"
replace 	airsup	=	1	if	ccode	==	663	&	battlename	==	"Jerusalem Corridor (July)"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Operation Horev (Late December)"
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Operation Horev (Late December)"
replace 	airsup	=	1	if	ccode	==	645	&	battlename	==	"Jerusalem Corridor (July)"
replace 	airsup	=	1	if	ccode	==	666	&	battlename	==	"Operation Hiram (Oct 20-31)"
replace 	airsup	=	2	if	ccode	==	732	&	battlename	==	"Punchbowl Battles"
replace 	airsup	=	0	if	ccode	==	731	&	battlename	==	"Inchon-Seoul Campaign"
replace 	airsup	=	0	if	ccode	==	731	&	battlename	==	"Punchbowl Battles"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Inchon-Seoul Campaign"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Punchbowl Battles"
replace 	airsup	=	2	if	ccode	==	732	&	battlename	==	"Inchon-Seoul Campaign"
replace 	airsup	=	0	if	ccode	==	732	&	battlename	==	"Invasion over 38th Parallel"
replace 	airsup	=	0	if	ccode	==	710	&	battlename	==	"Punchbowl Battles"
replace 	airsup	=	0	if	ccode	==	731	&	battlename	==	"Invasion over 38th Parallel"
replace 	airsup	=	0	if	ccode	==	310	&	battlename	==	"Budapest Nov 4-10, 1956"
replace 	airsup	=	2	if	ccode	==	365	&	battlename	==	"Budapest Nov 4-10, 1956"
replace 	airsup	=	2	if	ccode	==	220	&	battlename	==	"Operation Musketeer"
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Sinai"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Sinai"
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Operation Musketeer"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"Operation Musketeer"
replace 	airsup	=	1	if	ccode	==	750	&	battlename	==	"2nd NEFA, Nov 17-21"
replace 	airsup	=	1	if	ccode	==	710	&	battlename	==	"2nd NEFA, Nov 17-21"
replace 	airsup	=	1	if	ccode	==	770	&	battlename	==	"Sialkot"
replace 	airsup	=	1	if	ccode	==	750	&	battlename	==	"Sialkot"
replace 	airsup	=	2	if	ccode	==	817	&	battlename	==	"Tet Offensive (Saigon)"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Tet Offensive (Saigon)"
replace 	airsup	=	0	if	ccode	==	816	&	battlename	==	"Tet Offensive (Saigon)"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Samaria"
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Sinai (Northern)"
replace 	airsup	=	0	if	ccode	==	663	&	battlename	==	"Samaria"
replace 	airsup	=	0	if	ccode	==	652	&	battlename	==	"Northern Golan"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Sinai (Northern)"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Northern Golan"
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Various Raids"
replace 	airsup	=	1	if	ccode	==	666	&	battlename	==	"Various Raids"
replace 	airsup	=	1	if	ccode	==	92	&	battlename	==	"Nueva Ocotepeque"
replace 	airsup	=	1	if	ccode	==	91	&	battlename	==	"Nueva Ocotepeque"
replace 	airsup	=	2	if	ccode	==	750	&	battlename	==	"Operation Windfall (Central Eastern Front)"
replace 	airsup	=	0	if	ccode	==	770	&	battlename	==	"Operation Windfall (Central Eastern Front)"
replace 	airsup	=	1	if	ccode	==	651	&	battlename	==	"Contained offensive, Oct 14"
replace 	airsup	=	1	if	ccode	==	666	&	battlename	==	"Contained offensive, Oct 14"
replace 	airsup	=	0	if	ccode	==	652	&	battlename	==	"Southern Golan"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Southern Golan"
replace 	airsup	=	0	if	ccode	==	663	&	battlename	==	"Southern Golan"
replace 	airsup	=	2	if	ccode	==	640	&	battlename	==	"July 20-22 Turkish Offensive"
replace 	airsup	=	0	if	ccode	==	352	&	battlename	==	"July 20-22 Turkish Offensive"
replace 	airsup	=	0	if	ccode	==	811	&	battlename	==	"Vietnamese Offensive, Dec 1978 - Jan 1979"
replace 	airsup	=	2	if	ccode	==	816	&	battlename	==	"Vietnamese Offensive, Dec 1978 - Jan 1979"
replace 	airsup	=	1	if	ccode	==	816	&	battlename	==	"Xuan Loc, April 9-21"
replace 	airsup	=	1	if	ccode	==	817	&	battlename	==	"Xuan Loc, April 9-21"
replace 	airsup	=	0	if	ccode	==	520	&	battlename	==	"Second Battle of Jijiga, Feb 1978"
replace 	airsup	=	2	if	ccode	==	530	&	battlename	==	"Second Battle of Jijiga, Feb 1978"
replace 	airsup	=	2	if	ccode	==	40	&	battlename	==	"Second Battle of Jijiga, Feb 1978"
replace 	airsup	=	1	if	ccode	==	620	&	battlename	==	"Battle for Entebbe, Apr 1979"
replace 	airsup	=	1	if	ccode	==	510	&	battlename	==	"Battle for Entebbe, Apr 1979"
replace 	airsup	=	1	if	ccode	==	500	&	battlename	==	"Battle for Entebbe, Apr 1979"
replace 	airsup	=	1	if	ccode	==	710	&	battlename	==	"Lang Son Campaign"
replace 	airsup	=	1	if	ccode	==	816	&	battlename	==	"Lang Son Campaign"
replace 	airsup	=	1	if	ccode	==	645	&	battlename	==	"Faw Peninsula, Apr 17, 1988"
replace 	airsup	=	1	if	ccode	==	630	&	battlename	==	"Faw Peninsula, Apr 17, 1988"
replace 	airsup	=	0	if	ccode	==	160	&	battlename	==	"East Falkland Island, Jun 11-14"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"East Falkland Island, Jun 11-14"
replace 	airsup	=	0	if	ccode	==	652	&	battlename	==	"Peace for Galilee"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Peace for Galilee"
replace 	airsup	=	2	if	ccode	==	645	&	battlename	==	"Aug 2 Offensive"
replace 	airsup	=	0	if	ccode	==	690	&	battlename	==	"Aug 2 Offensive"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"Operation Desert Storm"
replace 	airsup	=	0	if	ccode	==	645	&	battlename	==	"Operation Desert Storm"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Operation Desert Storm"
replace 	airsup	=	0	if	ccode	==	531	&	battlename	==	"May 2000 Ethiopian Offensive"
replace 	airsup	=	2	if	ccode	==	530	&	battlename	==	"May 2000 Ethiopian Offensive"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Operation Anaconda"
replace 	airsup	=	0	if	ccode	==	700	&	battlename	==	"Operation Anaconda"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"Operation Anaconda"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"None on land"
replace 	airsup	=	0	if	ccode	==	770	&	battlename	==	"Tololing, June 12-13"
replace 	airsup	=	2	if	ccode	==	750	&	battlename	==	"Tololing, June 12-13"
replace 	airsup	=	2	if	ccode	==	740	&	battlename	==	"Beijing"
replace 	airsup	=	0	if	ccode	==	710	&	battlename	==	"Beijing"
replace 	airsup	=	2	if	ccode	==	365	&	battlename	==	"Changkufeng Hill"
replace 	airsup	=	0	if	ccode	==	740	&	battlename	==	"Changkufeng Hill"
replace 	airsup	=	0	if	ccode	==	220	&	battlename	==	"January Thai Offensive"
replace 	airsup	=	2	if	ccode	==	800	&	battlename	==	"January Thai Offensive"
replace 	airsup	=	0	if	ccode	==	713	&	battlename	==	"PRC Landings"
replace 	airsup	=	2	if	ccode	==	710	&	battlename	==	"PRC Landings"
replace 	airsup	=	2	if	ccode	==	220	&	battlename	==	"Spanish-French Offensive, February-April 1958"
replace 	airsup	=	2	if	ccode	==	230	&	battlename	==	"Spanish-French Offensive, February-April 1958"
replace 	airsup	=	0	if	ccode	==	600	&	battlename	==	"Spanish-French Offensive, February-April 1958"
replace 	airsup	=	0	if	ccode	==	710	&	battlename	==	"None on land"
replace 	airsup	=	2	if	ccode	==	713	&	battlename	==	"None on land"
replace 	airsup	=	0	if	ccode	==	816	&	battlename	==	"Late March Offensives"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Late March Offensives"
replace 	airsup	=	2	if	ccode	==	817	&	battlename	==	"Late March Offensives"
replace 	airsup	=	2	if	ccode	==	811	&	battlename	==	"Late March Offensives"
replace 	airsup	=	1	if	ccode	==	560	&	battlename	==	"December Offensive"
replace 	airsup	=	1	if	ccode	==	40	&	battlename	==	"December Offensive"
replace 	airsup	=	1	if	ccode	==	540	&	battlename	==	"December Offensive"
replace 	airsup	=	1	if	ccode	==	490	&	battlename	==	"December Offensive"
replace 	airsup	=	2	if	ccode	==	816	&	battlename	==	"Vietnamese Advance on Phnom Penh, 26 December 1978 - 7 January 1979"
replace 	airsup	=	0	if	ccode	==	811	&	battlename	==	"Vietnamese Advance on Phnom Penh, 26 December 1978 - 7 January 1979"
replace 	airsup	=	1	if	ccode	==	483	&	battlename	==	"Aouzou, August 1987"
replace 	airsup	=	1	if	ccode	==	620	&	battlename	==	"Aouzou, August 1987"
replace 	airsup	=	1	if	ccode	==	344	&	battlename	==	"??"
replace 	airsup	=	1	if	ccode	==	346	&	battlename	==	"??"
replace 	airsup	=	1	if	ccode	==	345	&	battlename	==	"??"
replace 	airsup	=	1	if	ccode	==	373	&	battlename	==	"Azeri December 1993 Offensive"
replace 	airsup	=	1	if	ccode	==	371	&	battlename	==	"Azeri December 1993 Offensive"
replace 	airsup	=	0	if	ccode	==	135	&	battlename	==	"Tiwintza"
replace 	airsup	=	2	if	ccode	==	130	&	battlename	==	"Tiwintza"
replace 	airsup	=	2	if	ccode	==	2	&	battlename	==	"Operation Iraqi Freedom"
replace 	airsup	=	2	if	ccode	==	200	&	battlename	==	"Operation Iraqi Freedom"
replace 	airsup	=	2	if	ccode	==	900	&	battlename	==	"Operation Iraqi Freedom"
replace 	airsup	=	0	if	ccode	==	645	&	battlename	==	"Operation Iraqi Freedom"

* War of Attrition
replace 	airsup	=	0	if	ccode	==	651	&	battlename	==	"Various Raids"
replace 	airsup	=	2	if	ccode	==	666	&	battlename	==	"Various Raids"

* Armenia vs Azerbaijan 1992
replace 	airsup	=	1	if	ccode	==	371	&	battlename	==	"Armenian Aug 1 Offensive"
replace 	airsup	=	1	if	ccode	==	373	&	battlename	==	"Armenian Aug 1 Offensive"

* Kosovo War: no land battles according to GH
replace 	airsup	=	2	if	ccode	==	2	&	warnumber	==	100
replace 	airsup	=	0	if	ccode	==	345	&	warnumber	==	100

* Taiwan Straits War of 1958: no land battles according to GH
replace 	airsup	=	2	if	ccode	==	713	&	warnumber	==	159
replace 	airsup	=	0	if	ccode	==	710	&	warnumber	==	159

replace	airsup	=	2	if	ccode	==	490	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup	=	2	if	ccode	==	540	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup	=	0	if	ccode	==	500	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup	=	0	if	ccode	==	517	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"


*****************************************************************************
* For some battles/wars, there is an alternative coding for air superiority.
*****************************************************************************

gen airsup_alt = airsup

replace	airsup_alt	=	2	if	ccode	==	2	&	battlename	==	"Guadalcanal (Henderson Field Oct 23-6)"
replace	airsup_alt	=	0	if	ccode	==	740	&	battlename	==	"Guadalcanal (Henderson Field Oct 23-6)"

replace	airsup_alt	=	1	if	ccode	==	255	&	battlename	==	"Winter Counteroffensive, Dec 1941 - Jan 1942"
replace	airsup_alt	=	1	if	ccode	==	365	&	battlename	==	"Winter Counteroffensive, Dec 1941 - Jan 1942"

replace	airsup_alt	=	0	if	ccode	==	770	&	battlename	==	"Naushera, Feb 6"
replace	airsup_alt	=	2	if	ccode	==	750	&	battlename	==	"Naushera, Feb 6"

replace	airsup_alt	=	1	if	ccode	==	666	&	battlename	==	"Operation Horev (Late December)"
replace	airsup_alt	=	1	if	ccode	==	651	&	battlename	==	"Operation Horev (Late December)"

replace	airsup_alt	=	0	if	ccode	==	92	&	battlename	==	"Nueva Ocotepeque"
replace	airsup_alt	=	2	if	ccode	==	91	&	battlename	==	"Nueva Ocotepeque"

replace	airsup_alt	=	2	if	ccode	==	645	&	battlename	==	"Faw Peninsula, Apr 17, 1988"
replace	airsup_alt	=	0	if	ccode	==	630	&	battlename	==	"Faw Peninsula, Apr 17, 1988"

replace	airsup_alt	=	0	if	ccode	==	483	&	battlename	==	"Aouzou, August 1987"
replace	airsup_alt	=	2	if	ccode	==	620	&	battlename	==	"Aouzou, August 1987"

replace	airsup_alt	=	1	if	ccode	==	490	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup_alt	=	1	if	ccode	==	540	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup_alt	=	1	if	ccode	==	500	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"
replace	airsup_alt	=	1	if	ccode	==	517	&	battlename	==	"Contained Rebel/R/U Offensive near Kinshaha"



save "airvictory.dta", replace 


*Multivariate tests*

eststo clear

/* M3 */
logit win msadopt polity politysquared cinc troopsengaged opptroopsengaged, cluster(ccode)
eststo
estat ic

logit win airsup polity politysquared cinc troopsengaged opptroopsengaged  if msadopt!=., cluster(ccode)
eststo
estat ic


logit win airsup msadopt polity politysquared cinc troopsengaged opptroopsengaged  if msadopt!=., cluster(ccode)
estat ic


eststo


esttab using "C:\Users\saund\Desktop\Table1.csv", label cells("b(star fmt(3))" se(par)) stats(aic bic r2_p N) nobaselevels  replace starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) title(Regression table\label{tab1})





*Who wins air superiority?*


gen politytri = 0
replace politytri = 1 if polity <=5
replace politytri = 3 if polity >=17
replace politytri = 2 if polity >5 & polity < 17


label def air 0 "No Air Superiority" 1 "Air Superiority"
label values airsupbinary air

tabout airsupbinary politytri if msadopt!=. using table1.tex, append stats(chi2) style(tex) h1(nil) h2( & Autocracy & Anocracy & Democracy\\) h3(nil)  bt topf(top2.tex) botf(bottom.tex)




gen d6 = 0 
replace d6 = 1 if polity >= 17 & polity !=.
replace d6 = . if polity == .
label var d6 "=1 if polity >= 17

gen anoc12 = 1 if polity > 5 & polity < 17 & polity !=.
replace anoc12 = 0 if anoc12 == . & polity != .

tabout win politytri if msadopt!=. & airsup ==0 using table1.tex, append stats(chi2) style(tex) h1(nil) h2( & Autocracy & Anocracy & Democracy\\) h3(nil)  bt topf(top2.tex) botf(bottom.tex)
tabout win politytri if msadopt!=. & airsup ==1 using table1.tex, append stats(chi2) style(tex) h1(nil) h2( & Autocracy & Anocracy & Democracy\\) h3(nil)  bt topf(top2.tex) botf(bottom.tex)
tabout win politytri if msadopt!=. & airsup ==2 using table1.tex, append stats(chi2) style(tex) h1(nil) h2( & Autocracy & Anocracy & Democracy\\) h3(nil)  bt topf(top2.tex) botf(bottom.tex)



*Multivariat Test*

eststo clear

logit win msadopt d6 anoc12 cinc troopsengaged opptroopsengaged, cluster(ccode)
eststo
logit win airsup msadopt d6 anoc12 cinc troopsengaged opptroopsengaged, cluster(ccode)
eststo

esttab using "Table1.csv", label cells("b(star fmt(3))" se(par)) stats(r2 N) nobaselevels  replace starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) title(Regression table\label{tab1})

